<?php
    include 'common/check.php';
    include 'rfq_do.php';
    include '../entity/material_entity.php';
    include '../business/material_manager.php';

    $materialEntity = new MaterialEntity();
    $materialMng = new MaterialMng();
    
    if ($rfqID) {
        $materialEntity->id                 = "-1";
        $materialEntity->rfqID              = $rfqID;
        $materialEntity->type               = $_POST['rd_type'];
        $materialEntity->qty                = $_POST['txt_qty'];
        $materialEntity->ciNumber           = $_POST['txt_ciNumber'];
        $materialEntity->tradeName          = $_POST['txt_tradeName'];
        $materialEntity->polymers           = $_POST['txt_polymers'];
        $materialEntity->processing         = $_POST['txt_processing'];
        $materialEntity->application        = $_POST['txt_application'];
        $materialEntity->specialEffect      = $_POST['txt_specialEffect'];
        $materialEntity->specialEquipment   = $_POST['txt_specailEquipment'];
        $materialEntity->inTime             = time();
        $materialEntity->inUser             = $_SESSION['userID'];

        if ($materialMng->update($materialEntity)) {
            echo "<script>window.location.href='rfq_submit.php'</script>";
        }
    }
    



?>
